#ifndef _PID_H_
#define _PID_H_

typedef struct
{
	float	SetSpeed;
	float	ActualSpeed;
	float	err;
	float	last_err;
	float	Kp,Ki,Kd;
	float	integral;
	float	intmax;
	float	umax;
	float	umin;
}T_PID;
extern T_PID pid;

void pid_init(float kp,float ki,float kd,int intmax);
int pid_set(int set_speed);
void pid_control(signed short speed);
void pid_control_vel(signed short speed);

extern float pid_out;



#endif
